<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="util.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>

<script type="text/javascript">

function createComponents(){
	
	var edName = new EditBox("name", getById("$name"));
	var edLogin = new EditBox("login", getById("$login"));
	var edPass = new EditBox("pass", getById("$pass"));
	var cbType = new ComboBox("type", getById("$type"));
	cbType.addOption("OPERADOR");
	cbType.addOption("ADMINISTRADOR");
	
	edName.render();
	edLogin.render();
	edPass.render();
	cbType.render();
	
}

function saveData(){
	var conn = new ClientConnector();
	
	var data = buildData(formComponents,actions.insert,"$user_form");
	
	conn.send(data);
}

</script>


<body onload="createComponents()">
<table>
<tr>
	<td colspan="2">Cadastro de Usuários</td>
</tr>
<tr>
	<td colspan="2">Nome:</td>
	<td colspan="2" id="$name"></td>
</tr>
<tr>
	<td colspan="2">Login:</td>
	<td colspan="2" id="$login"></td>
</tr>
<tr>
	<td colspan="2">Senha:</td>
	<td colspan="2" id="$pass"></td>
</tr>
<tr>
	<td colspan="2">Tipo de usuário</td>
	<td colspan="2" id="$type"></td>
</tr>
<tr>
	<td>
		<button onclick="saveData()">Gravar</button>
	</td>
	<td>
		<button>Cancelar</button>	
	</td>
	<td>
		<button>Excluir</button>	
	</td>
	<td>
		<button>Buscar</button>
	</td>
</tr>


</table>
</body>
</html>